﻿//Create By Leven
//Copyright 2008 LevenStudio
//http://leven.com.cn/
//For LevenBlog2.0
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace LevenBlog.Core.Entities
{
    /// <summary>
    ///表lb_tag
    /// </summary>
    [Serializable]
    [DataContract(Name = "tag")]
    [Table("lb_tag", Info = "")]
    public class lb_tag : BaseEntity
    {
        [DataMember]
        [Column("id", DataType.Int32, Length = 4, CanNull = false, AutoIncrement = true, PrimaryKey = true)]
        public int id { get; set; }

        [DataMember]
        [Column("name", DataType.VarChar, Length = 510, CanNull = false)]
        public string name { get; set; }

        [DataMember]
        [Column("intro", DataType.VarChar, Length = 2000)]
        public string intro { get; set; }

        [DataMember]
        [Column("num", DataType.Int32, Length = 4, CanNull = false)]
        public int num { get; set; }

        [DataMember]
        [Column("time", DataType.DateTime, CanNull = false)]
        public DateTime time { get; set; }

        [DataMember]
        [LinkTables("tagmap", SqlPrefix = "tagmap_")]
        public IList<lb_tagmap> tagmaps { get; set; }

        public lb_tag()
        {
            this.id = -1;
            this.intro = string.Empty;
            this.name = string.Empty;
            this.num = 0;
            this.time = DateTime.Now;
            this.tagmaps = new List<lb_tagmap>();
        }

    }
}

